{% extends 'title.html' %}

{% block content %}

    <a type="submit" style="margin-left: 195px;margin-bottom: 15px" class="btn btn-success"
       href="/nr_add/{{ nid.id }}/">添加内容</a>

    <form action="/nr/" method="post">
        {% csrf_token %}
        {% for i in nr1 %}

            <div class="panel panel-success" style="width: 900px;margin: auto;margin-bottom: 10px;">
                <div class="panel-heading">
                    <h3 class="panel-title" style="display: inline">{{ i.title.title }}</h3>
                    &nbsp
                    <h6 class="panel-primary" style="display: inline;">{{ i.date_add|date:'Y-m-d' }}</h6>
                    <span style="float: right">
                    <a href="{% url 'nr_edit' i.id %}" class="btn-group">编辑</a>
                    <a href="/nr_delete/?nid={{ i.id }}" style="color: red">删除</a>
                </span></div>
                <div class="panel-body">
                    {{ i.text }}
                </div>
            </div>
        {% empty %}
            <span class="list-group-item list-group-item-danger" style="width: 800px;margin: 30px auto;">
            该主题还没有条目
            </span>
        {% endfor %}
    </form>

{% endblock %}